FROM alpine:latest

LABEL maintainer="xiongjunfeng@haocang.com" \
    Timezone="Asia/Shanghai"

ADD entrypoint.sh /entrypoint.sh

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
  && apk add -U --no-cache tzdata openssh supervisor \
  && echo "${Timezone}" > /etc/timezone \
  && ln -sf /usr/share/zoneinfo/${SYS_TIMEZONE} /etc/localtime \
  && chmod +x /entrypoint.sh

ADD  sshd.ini /etc/supervisord.d/sshd.ini
ADD  supervisord.conf /etc/supervisord.conf

EXPOSE  22 9001

VOLUME  ["/etc/ssh"]

ENTRYPOINT  ["/entrypoint.sh"]

CMD [ "supervisord", "-c", "/etc/supervisord.conf" ]
